package com.wei.frame.di.component;

import android.app.Application;
import android.content.Context;

import androidx.recyclerview.widget.LinearLayoutManager;

import com.google.gson.Gson;
import com.wei.frame.App;
import com.wei.frame.db.DBManager;
import com.wei.frame.di.module.AppModule;
import com.wei.frame.net.RetrofitManager;
import com.wei.frame.ui.imageloader.ImageLoader;
import com.wei.frame.utils.AppManager;

import javax.inject.Named;
import javax.inject.Singleton;

import dagger.BindsInstance;
import dagger.Component;
import dagger.android.AndroidInjectionModule;
import dagger.android.AndroidInjector;

/**
 * 作者:赵若位
 * 时间:2020/8/20 2:31
 * 功能:
 */
@Singleton
@Component(modules = {AppModule.class, RvLayoutManager.class, ActivityBindingModule.class, AndroidInjectionModule.class})
public interface AppComponent extends AndroidInjector<App> {

//    void inject(@Nullable Application application);

    Context getContext();

    //Gson
    Gson gson();

    //图片加载框架
    ImageLoader getImageLoader();

    AppManager getAppManager();

    RetrofitManager getRetrofitManager();

    @Named("Horizintal")
    LinearLayoutManager getLinearHorizintalManager();

    @Named("Vertical")
    LinearLayoutManager getLinearVerticalManager();

    DBManager getDBManager();


    @dagger.Component.Builder
    interface Builder {
        @BindsInstance
        AppComponent.Builder application(Application application);

        AppComponent build();
    }
}
